home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 19 / Mac Magazin and MacEasy Magazine CD - Issue 19.iso / Online / LineShare 3.3.1 / ARA⁄LineShare / ARA_LineShare next >
Text File  |  1995-03-27  |  5KB  |  279 lines

  1. ! Version 3.0.3
  2. ! ARA 2.0 script for connections through a LineShare subPort.
  3. ! All modem-specific commands should be moved to the LineShare script.
  4. ! So, this ARA script is universal
  5. !
  6. ! We assume that the LineShare script has set the modem to the
  7. !   "Direct" mode, if the "CONNECT" message is detected
  8. !    (in this case our business is to adjust the serial port speed), or to the
  9. !   "Normal" mode, if the "CARRIER" message is detected.
  10. ! If LineShare returns the REL message,
  11. !   we tell ARA 2.0, that a reliable link is established
  12. !
  13. !
  14. @ORIGINATE
  15. @ANSWER
  16.   HSReset 0 0 0 0 0 0
  17. !
  18. ! Load Factory configurations (i.e. reset the LineShare emulator),switch off the echo
  19. !
  20.   matchclr
  21.   matchstr 1 1 "OK\13\10"
  22.   write "AT&FE0M^2\13"
  23.   matchread 10
  24.   jump 79
  25. @LABEL 1
  26. !
  27. ! The modem is ready so enable answering, or originate a call
  28. !
  29.   ifAnswer 10
  30. !
  31. ! 0,1,2 - Normal,Blind,Manual
  32.   ifStr 6 7 "0"
  33.   ifStr 6 5 "1"
  34.   ifStr 6 4 "2"
  35.   Jump 8
  36. !
  37. @LABEL 4
  38.   Note "Manual dialing initiated..." 3
  39.   Write "ATX1D \13"
  40.   Jump 15
  41. !
  42. @LABEL 5
  43.   note "Dialing without dialtone." 3
  44.   MatchClr
  45.   MatchStr 1 7 "OK\13\10"
  46.   Write "ATX3\13"
  47.   MatchRead 30
  48.   jump 79
  49. !
  50. ! Parameter 1 contains the full dialstring from the connection document.
  51. ! Parameter 3 contains "P" for pulse & "t" for tone dialing.
  52. ! Parameter 7, 8 & 9 contain the dial string fragments (only parameter 7 is used)
  53. @Label 7
  54.   Note "Dialing ^7." 3
  55.   Write "ATD^3^7\13"
  56.   Jump 15
  57. @Label 8
  58.   Note "Dialing ^1." 3
  59.   Write "ATDT^1\13"
  60.   Jump 15
  61. !
  62. !
  63. ! Answering
  64. @LABEL 10
  65.   MatchClr
  66.   MatchStr 1 15 "OK\13\10"
  67.   Write "ATS0=1\13"
  68.   MatchRead 30
  69.   Jump 79
  70. !
  71. @LABEL 15
  72.   MatchClr
  73.   MatchStr 1 19 "CARRIER "
  74.   Matchstr 2 18 "CONNECT "
  75.   matchstr 8 16 "RING\13\10"
  76.   matchstr 9 17 "REL\13\10"
  77.   matchstr 10 70 "NO CARRIER\13\10"
  78.   matchstr 11 70 "ERROR\13\10"
  79.   matchstr 12 72 "NO DIALTONE\13\10"
  80.   matchstr 13 73 "BUSY\13\10"
  81.   matchstr 14 74 "NO ANSWER\13\10"
  82.   matchread 800
  83.   ifAnswer 10
  84.   Jump 79
  85. !
  86. @LABEL 16
  87.   ifOriginate 15
  88.   userhook 1
  89.   note "Answering phone…" 2
  90.   Jump 15
  91. !
  92. @LABEL 17
  93.   userhook 2
  94.   note "Reliable link…" 3
  95.   jump 15
  96. !
  97. ! Process the "CONNECT" message - assume that we are in the "Direct" mode
  98. @LABEL 18
  99.   MatchClr
  100.   matchstr 2 22 "2400"
  101.   matchstr 3 23 "4800"
  102.   matchstr 4 24 "7200"
  103.   matchstr 5 25 "9600"
  104.   matchstr 6 26 "12000"
  105.   matchstr 7 27 "14400"
  106.   matchstr 8 28 "16800"
  107.   matchstr 9 29 "19200"
  108.   matchread 10
  109.   jump 79
  110.  
  111. !
  112. ! Process the "CARRIER" message - assume that we are in the Normal/REL mode
  113. @LABEL 19
  114.   MatchClr
  115.   matchstr 2 32 "2400\13"
  116.   matchstr 3 33 "4800"
  117.   matchstr 4 34 "7200"
  118.   matchstr 5 35 "9600"
  119.   matchstr 6 36 "12000"
  120.   matchstr 7 37 "14400"
  121.   matchstr 8 38 "16800"
  122.   matchstr 9 39 "19200"
  123.   matchstr 10 40 "21600"
  124.   matchstr 11 41 "24000"
  125.   matchstr 12 42 "26400"
  126.   matchstr 13 43 "28800"
  127.   matchread 10
  128.   jump 79
  129.  
  130. @LABEL 22
  131.   note "Communicating at 2400 bps." 2
  132.   setspeed 2400
  133.   jump 61
  134. !
  135. @LABEL 23
  136.   note "Communicating at 4800 bps." 2
  137.   setspeed 4800
  138.   jump 61
  139. !
  140. @LABEL 24
  141.   note "Communicating at 7200 bps." 2
  142.   setspeed 7200
  143.   jump 61
  144. !
  145. @LABEL 25
  146.   note "Communicating at 9600 bps." 2
  147.   setspeed 9600
  148.   jump 61
  149. !
  150. @LABEL 26
  151.   note "Communicating at 12000 bps." 2
  152.   setspeed 12000
  153.   jump 61
  154. !
  155. @LABEL 27
  156.   note "Communicating at 14400 bps." 2
  157.   setspeed 14400
  158.   jump 61
  159. !
  160. @LABEL 28
  161.   note "Communicating at 16800 bps." 2
  162.   setspeed 16800
  163.   jump 61
  164. !
  165. @LABEL 29
  166.   note "Communicating at 19200 bps." 2
  167.   setspeed 19200
  168.   jump 61
  169. !
  170. ! CARRIER XXXX processing
  171. !
  172. @LABEL 32
  173.   note "Linked at 2400 bps." 2
  174.   CommunicatingAT 2400
  175.   jump 60
  176. !
  177. @LABEL 33
  178.   Note "Linked at 4800 bps." 2
  179.   CommunicatingAT 4800
  180.   jump 60
  181. !
  182. @LABEL 34
  183.   note "Linked at 7200 bps." 2
  184.   CommunicatingAT 7200
  185.   jump 60
  186. !
  187. @LABEL 35
  188.   note "Linked at 9600 bps." 2
  189.   CommunicatingAT 9600
  190.   jump 60
  191. !
  192. @LABEL 36
  193.   note "Linked at 12000 bps." 2
  194.   CommunicatingAT 12000
  195.   jump 60
  196. !
  197. @LABEL 37
  198.   note "Linked at 14400 bps." 2
  199.   CommunicatingAT 14400
  200.   jump 60
  201. !
  202. @LABEL 38
  203.   note "Linked at 16800 bps." 2
  204.   CommunicatingAT 16800
  205.   jump 60
  206. !
  207. @LABEL 39
  208.   note "Linked at 19200 bps." 2
  209.   CommunicatingAT 19200
  210.   jump 60
  211. !
  212. @LABEL 40
  213.   note "Linked at 21600 bps." 2
  214.   CommunicatingAT 21600
  215.   jump 60
  216. !
  217. @LABEL 41
  218.   note "Linked at 24000 bps." 2
  219.   CommunicatingAT 24000
  220.   jump 60
  221. !
  222. @LABEL 42
  223.   note "Linked at 26400 bps." 2
  224.   CommunicatingAT 26400
  225.   jump 60
  226. !
  227. @LABEL 43
  228.   note "Linked at 28800 bps." 2
  229.   CommunicatingAT 28800
  230.   jump 60
  231. !
  232. @LABEL 60
  233.   HSReset 0 1 0 0 0 0
  234. @LABEL 61
  235.   ifANSWER 62
  236.   pause 30
  237. @LABEL 62
  238.   exit 0
  239. !
  240. !
  241. ! 70: error messages
  242. ! No carrier
  243. @LABEL 70
  244.   exit -6021
  245. ! No Dial Tone
  246. @LABEL 72
  247.   exit -6020
  248. ! Busy
  249. @LABEL 73
  250.   exit -6022
  251. ! No Answer
  252. @LABEL 74
  253.   exit -6023
  254. ! Invalid Varstring Value
  255. @LABEL 76
  256. exit -6027
  257. ! Modem error
  258. @LABEL 79
  259.   exit -6019
  260. !
  261. ! Hang up the modem
  262. !
  263. @HANGUP
  264.   HSReset 0 0 0 0 0 0
  265.   settries 0
  266. @LABEL 80
  267.   DTRClear
  268.   pause 2
  269.   DTRSet
  270.   write "ATZ\13"
  271.   matchclr
  272.   matchstr 1 82 "OK\13\10"
  273.   matchread 30
  274.   inctries
  275.   iftries 3 82
  276.   jump 80
  277. !
  278. @LABEL 82
  279.   exit 0